﻿using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Application.Services;
using YaAppoint.Appointments.ManualAppoints;
using YaAppoint.Devices;
using YaAppoint.Response;

namespace YaAppoint.Appointments.Pools
{
    [RemoteService(isEnabled:false)]
    public interface IPoolAppService:IApplicationService
    {
        Task<BackJson> SubmitCreate(CreatePoolDto dto);

        /// <summary>
        /// 获取特殊排班中包含的号池
        /// </summary>
        /// <param name="sid">特殊排班ID</param>
        /// <returns></returns>
        Task<BackJson> GetPoolList(Guid sid, int page, int pageSize);

        /// <summary>
        /// 人工预约
        /// 根据日期 和 设备 获取号池
        /// </summary>
        /// <param name="queryDto"></param>
        /// <returns></returns>
        Task<BackJson> GetPoolList(PoolQueryDto queryDto);

        Task<BackJson> SubmitEdit(PoolDto dto);

        Task<BackJson> GetAsync(Guid id);

        Task<BackJson> DeletePool(Guid id);

        Task<BackJson> DeletePoolMany(List<Guid> idList);

        Task<BackJson> BatchCreate(BatchCreatePoolModel batchModel, Guid sid);

        Task<BackJson> EnableToggle(Guid id);


        /// <summary>
        /// 按照计划号池创建指定设备、指定日期下的所有号池
        /// 确保计划号池对应的实际号池存在
        /// 如果指定设备的指定日期是按照计划号池走的，检查计划号池在特定设备特定日期下是否有对应实际保持，如果有则忽略，没有则为其创建实际号池
        /// 如果指定设备的指定日期有特殊安排，则不执行任何操作
        /// </summary>
        /// <param name="deviceId"></param>
        /// <param name="date"></param>
        /// <returns></returns>
        Task CreateDeviceAllPoolsOnDate(Guid deviceId, DateTime date);

        Task CreateAllDevicesAllPools(List<DeviceDto> devices, DateTime date);
    }
}
